import java.util.Arrays;
public class Test {
    public static int[] transform1(int[] array) {
        int[] tmpArr = new int[array.length];

        for (int i = 0; i < array.length; i++) {
            tmpArr[i] = 2 * array[i];
        }
        return tmpArr;
    }
    public static void main1(String[] args) {
        int[] arr = {1,2,3};
        transform(arr);
        System.out.println(Arrays.toString(arr));
    }

    public static void func2(int[] array) {   //第四题
        int i=0;
        int j=array.length-1;
        while(i<j) {
            while (i<j && array[i] % 2 != 0) {  //i从左边找偶数
                i++;
            }
            while (i<j && array[j] % 2 == 0) {  //i从右边找奇数
                j++;
            }
            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
    }
    public static void main2(String[] args) {

    }

    public static int[] fun5(int[] array,int target) {  //第五题
        int[] ret = new int[2];
        for(int i=0;i < array.length;i++) {
            for(int j = i+1;j < array.length;j++) {
                if(array[i]+array[j] == target) {
                    ret[0] = i;
                    ret[1] = j;
                    return ret;
                }
            }
        }
        return ret;
    }
    public static void main5 (String[] args) {

    }

    public static int fun6(int[] array) {
        int tet = 0;
        for(int i = 0; i<array.length;i++) {
            ret = ret ^ array[i];
        }
        return ret;
    }







    public void BubbleSort(int[] array) {
        int len = array.length;
        for (int i = 0; i < len - 1; i++) {
            boolean flg = false;  //检查每一趟后，是否有序？
            for(int j = 0;j < len - 1 - i;i++) {
                if(array[j] > array[j+1]) {
                    int tmp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = tmp;
                    flg = true;
                }
            }
            if(flg == false) {
                return;
            }

        }
    }

    public static void main1(String[] args) {
        int[][] array1 = new int [2][3];
        int[][] array2 = new int [][] {{1,2,3},{4,5,6}};
        int[][] array3 = {{1,2,3},{4,5,6}};


    }
}
